package com.ruoyi.gather.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.gather.api.domain.ErpCollectProductExpand;
import com.ruoyi.gather.api.domain.ErpCollectProductSku;
import com.ruoyi.gather.api.domain.ErpProductAtlas;
import com.ruoyi.gather.api.domain.ErpProductUnifiedTakedown;
import com.ruoyi.gather.api.domain.dto.ComputeFreightDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.constraints.NotNull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@FeignClient(contextId = "remoteCollectProductService", value = ServiceNameConstants.GATHER_SERVICE)
public interface RemoteCollectProductService {

    /**
     * 通过id获取公共库产品信息
     */
    @GetMapping("/gather/collectProduct/getCollectProductInfoById/{id}")
    public R<Object> getCollectProductInfoById(@PathVariable("id") Long id);

    @PostMapping("/gather/productUnifiedTakedown/getProductUnifiedTakedownInfo")
    public R<Object> getProductUnifiedTakedownInfo(@RequestBody ErpProductUnifiedTakedown erpProductUnifiedTakedown);

    @PostMapping("/gather/productUnifiedTakedown/getProductUnifiedTakedownListInfo")
    public R<Object> getProductUnifiedTakedownListInfo(@RequestBody ErpProductUnifiedTakedown erpProductUnifiedTakedown);

    @GetMapping("/gather/collectProductPublishTask/getCollectProductPublishTaskOneOrderByCreateTime/{productId}/{userId}")
    R<Object> getCollectProductPublishTaskOneOrderByCreateTime(@PathVariable("productId") String productId, @PathVariable("userId") Long userId);

    @PostMapping("/gather/collectProductExpand/getCollectProductExpandInfo")
    R<Object> getCollectProductExpandInfo(@RequestBody ErpCollectProductExpand collectProductExpandSel);

    //        @PostMapping("/gather/collectProduct/publishAutoInnerAuth")
//    R<Object> publishAutoInnerAuth(@RequestBody Map<String,String> map);
    @GetMapping("/gather/collectProduct/publishAutoInnerAuth/{productId}/{userId}/{taskId}")
    R<Object> publishAutoInnerAuth(
            @PathVariable("productId") String productId, @PathVariable("userId") String userId, @PathVariable("taskId") String taskId
    );

    @PostMapping("/gather/collectProductSku/getCollectProductSkuInfo")
    R<Object> getCollectProductSkuInfo(@RequestBody ErpCollectProductSku erpCollectProductSkuSel);

    @PostMapping("/gather/collectProductSku/getCollectProductSkuListInfo")
    R<Object> getCollectProductSkuListInfo(@RequestBody ErpCollectProductSku erpCollectProductSkuSel);

    @PostMapping("/gather/getCollectProductCategoryInfoInner/{collectId}")
    R<Object> getCollectProductCategoryInfoInner(@PathVariable("collectId") Long collectId);

    @GetMapping("/gather/collectProduct/setProToOrder/{skuCode}")
    R<Object> setProToOrder(@PathVariable("skuCode") String skuCode);

    /**
     * 根据采集商品id获取商品的类目名
     */
    @GetMapping("/gather/collectProduct/getCategoryByCollectId/{collectProductId}")
    Map<String, Object> getCategoryByCollectId(@PathVariable("collectProductId") Long collectProductId);

    /**
     * 根据标签获取信息
     *
     * @param tagId 主键
     */
    @GetMapping("/gather/productAtlas/byTagId{tagId}")
    R<ErpProductAtlas> getByTagId(@PathVariable("tagId") Long tagId);

    @GetMapping("/gather/collectProduct/updateSkuPropertyByProductA")
    R<Object> updateSkuPropertyByProductA(@RequestBody ComputeFreightDto collectProductA);

    @GetMapping("/gather/collectProduct/queryCategoryBySubject/{subject}")
    R<Object> queryCategoryBySubject(@PathVariable("subject") String subject);

    @GetMapping("/gather/collectProductTranslateTask/translateTask")
    R<Object> translateTask();

    /**
     * @Description: 查询品牌ID和对应的商品数量
     * @Author: j.zh
     * @Date: 2024/7/4
     * @return
     * @Version: 4.2.0
     **/
    @GetMapping("/gather/collectProductExpand/getBrandAndProductCount")
    R<Object> getBrandAndProductCount();
}
